package de.hszigr.inf.webapp;

import org.apache.click.util.Bindable;

import de.hszigr.inf.model.User;
import de.hszigr.inf.webapp.common.BorderTemplate;

public class Logout extends BorderTemplate {
	
	
	@Bindable User user;
	
	public Logout(){
	}

    @Override
    public void onInit() {
        super.onInit();
        System.out.println("INIT");
        user = (User) getContext().getSessionAttribute("currentUser");
        if (user != null) {
            getContext().removeSessionAttribute("currentUser");
            setRedirect(HomeCMS.class);
        }
        else{
        	
        }
    }
    
    @Override
    public void onGet() {
    	// TODO Auto-generated method stub
    	System.out.println("GET");
    	
    	setRedirect(HomeCMS.class);
    }
	
}